Use the Camera node to show the content of a Scene in your Kanzi Studio project and in your Kanzi application. When you create a Scene it contains only a Camera node and a Directional Light. This is the default Camera node and preview camera for that Scene. When a Camera node is a preview camera, in the Preview you see the Scene through that Camera node. In the Project the preview camera is marked with (Preview).
Do not scale Camera nodes, or ancestors of Camera nodes, using either Render Transformation or Layout Transformation properties. When you scale a Camera node you affect the projection so that it does not match the parameters you set.
To set the position of a Camera node:
Control | Description |
---|---|
Click and drag the left mouse button. | Rotate |
| Pan |
| Zoom |
Control | Description |
---|---|
W | Move forward. Hold down Shift to double the speed. |
S | Move backward. Hold down Shift to double the speed. |
A | Move left. Hold down Shift to double the speed. |
D | Move right. Hold down Shift to double the speed. |
Q | Tilt left. |
E | Tilt right. |
Click and drag the left mouse button. | Rotate |
Click and drag the middle mouse button. | Pan |
Scroll the mouse wheel. | Set camera speed. Scroll down to decrease the camera speed. Scroll up to increase the camera speed. |
Control | Description |
---|---|
Store the current position of the camera to the preview Camera node. | |
Reset the camera to the current position of the preview Camera node. | |
Create a new Camera node from the current position of the camera. | |
Bring the camera to the 3D object selected in the Project or the Preview. | |
Select the Camera node through which you want to view the current scene. | |
Set the field of view for the camera in degrees when working with 3D nodes. |
When a Camera node is a preview camera, in the Preview you see the Scene through that Camera node. In the Project the preview camera is marked with (Preview).
To turn a Camera node into a preview camera:
Or
If the scene is not visible in the Preview even after you set a preview camera, you need to activate the scene. See Using the Scene node.
The Camera tool allows you to quickly view the content of an entire Scene from one of the preset viewpoints: front, back, top, bottom, left, or right side. Unless you switched on the option to store the current position of the camera (), the preset viewpoints do not change the position of the Camera nodes in a Scene. See Setting the position of Camera nodes.
To view the entire active Scene from a preset viewpoint:
Preset viewpoint | Shortcut |
---|---|
View an entire Scene from the left side. | Shift+1 |
View an entire Scene from the right side. | Shift+2 |
View an entire Scene from the top. | Shift+3 |
View an entire Scene from the bottom. | Shift+4 |
View an entire Scene from the front. | Shift+5 |
View an entire Scene from the back. | Shift+6 |
You can create a new Camera node in these ways:
Or
To set the projection type of a Camera node, in the Project select the Camera node and in the Properties set the Projection Type property:
Create a camera with a perspective projection:
// Create a camera named Camera. CameraSharedPtr camera = Camera::create(domain, "Camera"); // Set the projection of the camera to perspective. camera->setPerspectiveProjection(); // Make the viewing box display a horizontal 90 degree cone of the 3D space. // The vertical cone angle is determined by the viewport aspect ratio. camera->setFovType(Camera::YFov); camera->setFov(90.0f); camera->setZNear(0.1f); camera->setZFar(100.0f);
Create a camera with an orthographic projection:
// Create a camera named Camera. CameraSharedPtr camera = Camera::create(domain, "Camera"); // Set the projection of the camera to relative orthogonal. camera->setOrthogonalProjection(Camera::OrthogonalCoordinateSystemRelative); // Make the viewing box display [-width,width] x [-1, 1] x [-1, 1] portion of the 3D space. // The width of the viewing box is determined by the viewport aspect ratio. camera->setOrthogonalPlaneHeight(1.0f); camera->setZNear(-1.0f); camera->setZFar(1.0f);
For details, see the Camera
class in the API reference.
For a list of the available property types and messages for the Camera node, see Camera.
Making nodes turn to a Camera node